home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-14 | 22.1 KB | 623 lines | [TEXT/KAHL] |
- $$Loop ModelessDialogs
- $$Message MM Modeless Dialog, mm:mmMD_$Worksheet.name$.c
-
- $$File mm:mmMD_$Worksheet.name$.c
- /* mmMD_$Worksheet.name$ Handle this dialog */
- /* $CopyRight$ */
-
- /* File name: mmMD_$Worksheet.name$.c
- Function: Handle this modeless dialog.
-
- This dialog is called when:
-
- History: $Date$ Original by $Author$
-
- */
-
- /* ======================================================= */
- /* ======================================================= */
-
- #include "mmCommon$Prototype.name$.h" /* Common */
- #include "Common$Prototype.name$.h" /* Common */
-
- #include "$Worksheet.name$.h"
-
- /* ======================================================= */
- /* ======================================================= */
-
- /* Routine: Init_$Worksheet.name$ */
- /* Purpose: This procedures purpose is to set the window pointer to nil, */
- /* this is used to tell the other routines */
-
- void Init_$Worksheet.name$(void)
- {
- Rect tempRect; /* Temporary rectangle */
- short DType; /* Type of dialog item */
- short Index; /* For looping */
- Handle DItem; /* Handle to the dialog item */
- ControlHandle CItem, CTempItem; /* Control handle */
- Str255 sTemp; /* Get text entered, temp holding */
- short itemHit; /* Get selection */
- short temp; /* Get selection, temp holding */
-
-
- Rec_$Worksheet.name$.theDialog = nil; /* Initialize to say that the dialog is not yet active */
-
- $$Loop Control.type = Button
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Button */
- $$EndLoop
- $$Loop Control.type = HotRect
- $$if Control.HotSpot
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* HotSpot */
- $$endif
- $$EndLoop
- $$Loop Control.type = Checkbox
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Checkbox */
- $$if Control.Selected
- Rec_$Worksheet.name$.Value_$Control.name$ = 1;
- $$endif
- $$if Control.Unselected
- Rec_$Worksheet.name$.Value_$Control.name$ = 0;
- $$endif
- $$EndLoop
- $$Loop Control.type = Radio
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Radio */
- $$if Control.Selected
- Rec_$Worksheet.name$.Value_$Control.name$ = 1;
- $$endif
- $$if Control.Unselected
- Rec_$Worksheet.name$.Value_$Control.name$ = 0;
- $$endif
- $$EndLoop
- $$Loop Control.type = ScrollBar
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* ScrollBar */
- Rec_$Worksheet.name$.Value_$Control.name$ = $Control.ValueScroll$;
- $$EndLoop
- $$Loop Control.type = Icon
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Icon button */
- $$EndLoop
- $$Loop Control.type = Sicn
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Sicn button */
- $$EndLoop
- $$Loop Control.type = Picture
- $$if Control.NonGraphic
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Picture button */
- $$endif
- $$EndLoop
- $$Loop Control.type = UButton
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Plugin button */
- $$EndLoop
- $$Loop Control.type = UToggle
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Plugin toggle */
- $$if Control.Selected
- Rec_$Worksheet.name$.Value_$Control.name$ = 1;
- $$endif
- $$if Control.Unselected
- Rec_$Worksheet.name$.Value_$Control.name$ = 0;
- $$endif
- $$EndLoop
- $$Loop Control.type = UGauge
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Plugin gauge */
- Rec_$Worksheet.name$.Value_$Control.name$ = $Control.ValueScroll$;
- $$EndLoop
- $$Loop Control.type = Popup
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Popup menu */
- Rec_$Worksheet.name$.Value_$Control.name$ = $Control.SelectedID$;
- $$EndLoop
- $$Loop Control.type = Palette
- Rec_$Worksheet.name$.Enable_$Control.name$ = $Control.Active$; /* Palette */
- Rec_$Worksheet.name$.Value_$Control.name$ = $Control.ValueScroll$;
- $$EndLoop
- $$Loop Control.type = List
- Rec_$Worksheet.name$.List_$Control.name$ = nil; /* List */
- SetRect(&Rec_$Worksheet.name$.ListRect_$Control.name$,$Control.LeftPosition$,$Control.TopPosition$,$Control.RightPosition$,$Control.BottomPosition$); /* left,top,right,bottom */
- $$EndLoop
- $$Loop Control.type = EditText
- Rec_$Worksheet.name$.TE_$Control.name$ = nil; /* Edit Text */
- SetRect(&Rec_$Worksheet.name$.TERect_$Control.name$,$Control.LeftPosition$,$Control.TopPosition$,$Control.RightPosition$,$Control.BottomPosition$); /* left,top,right,bottom */
- GetIndString(Rec_$Worksheet.name$.TEStr_$Control.name$,sResD_$Control.name$,1);/* ...Edit text, default value */
-
- $$EndLoop
-
- U_Init_$Worksheet.name$(); /* Call the user init routine */
- }
-
- /* ======================================================= */
-
- /* Routine: Moved_$Worksheet.name$ */
- /* Purpose: We were moved, possibly to another screen and screen depth */
-
- void Moved_$Worksheet.name$(Rect *OldRect,WindowPtr theWindow)/* Moved this window */
- {
- WindowPtr SavePort; /* Place to save the last port */
-
-
- if (Rec_$Worksheet.name$.theDialog == theWindow) /* Only do if the window is us */
- {
- GetPort(&SavePort); /* Save the current port */
- SetPort(theWindow); /* Set the port to my window */
-
- U_Moved_$Worksheet.name$(theWindow,OldRect); /* Call user routine when we are moved */
- SetPort(SavePort); /* Restore the old port */
- } /* End of IF */
- }
-
- /* ======================================================= */
-
- /* Routine: Update_$Worksheet.name$ */
- /* Purpose: This procedures purpose is to refresh this window, update it, */
- /* when we are uncovered by another window. */
-
- void Update_$Worksheet.name$(WindowPtr theWindow)
- {
- GrafPtr SavedPort; /* Save the current port so we can restore to it */
- Rect tempRect; /* Temporary rectangle variable */
- Rect rTempRect; /* Temporary rectangle variable */
- short DType; /* Type of dialog item */
- Handle DItem; /* Handle to the dialog item */
- ControlHandle CItem; /* Control handle */
- RGBColor Saved_ForeColor; /* Place to save colors */
- RGBColor Saved_BackColor; /* Place to save colors */
- RGBColor DrawingColor; /* Place to make colors */
-
-
- if ((Rec_$Worksheet.name$.theDialog != nil) && (theWindow == Rec_$Worksheet.name$.theDialog))/* Only do if we are the window to update */
- {
- GetPort(&SavedPort); /* Get the current port */
- SetPort(theWindow); /* Point to our port for drawing in our window */
- if (Has.ColorQD) /* See if color QuickDraw is around */
- {
- GetForeColor(&Saved_ForeColor); /* Save the fore color */
- GetBackColor(&Saved_BackColor); /* Save the back color */
-
- RGBForeColor(&Black_ForeColor); /* Set the fore color to Black */
- RGBBackColor(&White_BackColor); /* Set the back color to White */
- } /* End of IF */
-
- $$Loop Control.type = Button
- $$if Control.Default
- /* This is the default selection, when RETURN is pressed. */
- HiliteDefaultButton(theWindow,ResD_$Control.name$);
-
- $$endif Control.Default
- $$EndLoop Control.type
- $$Loop Control.type = Line
- /* Draw a line, $Control.FullName$ */
- $$if Control.GrayLine
- PenPat(&qd.gray); /* Set the gray pen pattern */
- $$endif Control.GrayLine
- $$if Control.LineWidth ! 1
- PenSize($Control.LineWidth$,$Control.LineWidth$);
- $$endif Control.LineWidth
- MoveTo($Control.LeftPosition$,$Control.TopPosition$); /* Horz,vert, Move to starting position */
- LineTo($Control.RightPosition$,$Control.BottomPosition$); /* Horz,vert, Draw to the ending position */
- $$if Control.LineWidth ! 1
- PenSize(1,1);
- $$endif Control.LineWidth
- $$if Control.GrayLine
- PenPat(&qd.black); /* Back to default pen pattern */
- $$endif Control.GrayLine
-
- $$EndLoop
- $$Loop Control.type = StaticText
- $$if Control.SpecialText
- /* Draw static text, $Control.FullName$ */
- $$if Control.TextColor ! Black
- if (Has.ColorQD) /* See if color QuickDraw is around */
- {
- DrawingColor.red = 0x$Control.RedTextColor$;
- DrawingColor.green = 0x$Control.GreenTextColor$;
- DrawingColor.blue = 0x$Control.BlueTextColor$;
- RGBForeColor(&DrawingColor); /* Set the fore color */
- RGBBackColor(&Saved_BackColor); /* Set the back color */
- }
- $$endif Control.TextColor
- $$if Control.MultipleLine
- SetRect(&tempRect,$Control.LeftPosition$,$Control.TopPosition$,$Control.RightPosition$,$Control.BottomPosition$);
- DrawStaticTextBox(sResD_$Control.name$,&tempRect,$Control.TextAlignment$,$Control.TextSize$,$Control.TextFont$,$Control.TextStyle$);
- $$endif Control.MultipleLine
- $$if Control.SingleLine
- DrawStaticLine(sResD_$Control.name$,$Control.LeftPosition$,$Control.TopPosition$,$Control.TextSize$,$Control.TextFont$,$Control.TextStyle$);
- $$endif Control.SingleLine
- $$if Control.TextColor ! Black
- if (Has.ColorQD) /* See if color QuickDraw is around */
- {
- RGBForeColor(&Black_ForeColor); /* Set the fore color */
- RGBBackColor(&White_BackColor); /* Set the back color */
- }
- $$endif Control.TextColor
-
- $$endif Control.SpecialText
- $$EndLoop
- $$Loop Control.type = List
- UpdateTheList(theWindow->visRgn,Rec_$Worksheet.name$.List_$Control.name$,&Rec_$Worksheet.name$.ListRect_$Control.name$,
- $Control.TextSize$,$Control.TextFont$,$Control.TextStyle$,true);
-
- $$EndLoop
- TextSize(12);
- TextFont(systemFont); /* Select the Font that we want */
- TextFace(0); /* Select the style that we want */
-
- if (Has.ColorQD) /* See if color QuickDraw is around */
- {
- RGBForeColor(&Saved_ForeColor); /* Restore the fore color */
- RGBBackColor(&Saved_BackColor); /* Restore the back color */
- } /* End of IF */
-
- U_Update_$Worksheet.name$(theWindow); /* Call the user update routine */
-
- DrawDialog(theWindow); /* Draw the rest of the controls */
- SetPort(SavedPort); /* Restore the port that we saved at the start */
- } /* End of IF */
- }
-
- /* ======================================================= */
-
- /* Routine: Open_$Worksheet.name$ */
- /* Purpose: This procedures purpose is to open this window and set all */
- /* of the initial conditions, such as default edit text. */
-
- void Open_$Worksheet.name$(void)
- {
- TEHandle ThisEditText;
- Rect tempRect; /* Temporary rectangle variable */
- short DType; /* Type of dialog item */
- Handle DItem; /* Handle to the dialog item */
- ControlHandle CItem; /* Control handle */
- long LTemp,LTemp2,theLong; /* Get selection, temp holding */
-
-
- if (Rec_$Worksheet.name$.theDialog == NIL)
- {
- Rec_$Worksheet.name$.theDialog = GetNewDialog(ResD_$Worksheet.name$, NIL, (WindowPtr)-1 );/* Bring in the dialog resource */
- SetPort(Rec_$Worksheet.name$.theDialog); /* Prepare to add conditional text */
-
- $$if Worksheet.Center
- tempRect = Rec_$Worksheet.name$.theDialog->portRect; /* Get the windows position and size */
- $$if Worksheet.CenterHorz
- tempRect.left = ((screenRect.bounds.right - screenRect.bounds.left) - (tempRect.right - tempRect.left)) / 2; /* Center Horz */
- $$endif Worksheet.CenterHorz
- $$if Worksheet.CenterVert
- tempRect.top = ((screenRect.bounds.bottom - screenRect.bounds.top) - (tempRect.bottom - tempRect.top)) / 3; /* 1/3 vert */
- if (tempRect.top < 40) /* Keep below the menu bar */
- tempRect.top = 40;
- $$endif Worksheet.CenterVert
- MoveWindow(Rec_$Worksheet.name$.theDialog,tempRect.left,tempRect.top,true);
-
- $$endif
- $$if ModelessDialog.Movable
- Doing_MovableModal = true;
-
- $$endif ModelessDialog.Movable
- $$Loop Control.type = Button
- /* Button */
- SetupNormalControl(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,0);
-
- $$EndLoop Control.type
- $$Loop Control.type = Checkbox
- /* Checkbox */
- SetupNormalControl(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
- Rec_$Worksheet.name$.Value_$Control.name$);
-
- $$EndLoop Checkbox
- $$Loop Control.type = Radio
- /* Radio button */
- SetupNormalControl(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
- Rec_$Worksheet.name$.Value_$Control.name$);
-
- $$EndLoop Radio
- $$Loop Control.type = List
- /* Make a List */
- Make_A_List(&Rec_$Worksheet.name$.List_$Control.name$,&Rec_$Worksheet.name$.ListRect_$Control.name$,
- Rec_$Worksheet.name$.theDialog,sResD_$Control.name$,$Control.TextSize$,$Control.TextFont$,$Control.TextStyle$,true);
-
- $$EndLoop
- $$Loop Control.type = HotRect
- /* Draw a Hotspot or Rectangle */
- SetupHotSpot(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,$Control.MakeHotSpot$,$Control.LineWidth$,
- $Control.ShadowWidth$,sResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$);
-
- $$EndLoop
- $$Loop Control.type = EditText
- GetDItem(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,&DType,&DItem,&tempRect);/* Get the item handle */
- GetIndString(sTemp,sResD_$Control.name$,1); /* ...Edit text, default value */
- SetIText(DItem,sTemp); /* Set the default text string */
- SelIText(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,0,300);
-
- $$EndLoop
- $$Loop Control.type = Popup
- SetupPopupMenu(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
- mResD_$Control.name$,Rec_$Worksheet.name$.Value_$Control.name$);
-
- $$EndLoop
- $$Loop Control.type = Picture
- $$if Control.NonGraphic
- /* Draw a picture */
- LTemp = ResD_N_$Control.name$; /* Picture ID and resize flag */
- $$if Control.ClipPicture
- LTemp = 0x00010000 | LTemp;
- $$endif Control.ClipPicture
- SetupTheItem(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,true,true,
- Rec_$Worksheet.name$.Enable_$Control.name$,false,&tempRect,LTemp,0);
-
- $$endif Control.NonGraphic
- $$EndLoop
- $$Loop Control.type = Palette
- /* Draw a Palette */
- SetupPalette(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
- $Control.NumRows$,$Control.NumColumns$,ResD_N_$Control.name$,$Control.HMethod$);
-
- $$EndLoop
- $$Loop Control.type = Icon
- $$if Control.NonGraphic
- /* Draw an Icon button */
- SetupIconSicn(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
- ResD_N_$Control.name$,ResD_H_$Control.name$);
-
- $$endif Control.NonGraphic
- $$EndLoop
- $$Loop Control.type = Sicn
- /* Draw a Sicn */
- $$if Control.Graphic
- SetupIconSicn(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
- ResD_N_$Control.name$,ResD_N_$Control.name$);
- $$endif Control.Graphic
- $$if Control.NonGraphic
- SetupIconSicn(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
- ResD_N_$Control.name$,ResD_H_$Control.name$);
- $$endif Control.NonGraphic
-
- $$EndLoop
- $$Loop Control.type = UButton
- SetupPlugin(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
- ResD_N_$Control.name$,ResD_H_$Control.name$,sResD_$Control.name$);
-
- $$EndLoop
- $$Loop Control.type = UToggle
- SetupPlugin(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
- ResD_N_$Control.name$,ResD_H_$Control.name$,sResD_$Control.name$);
-
- $$EndLoop
- $$Loop Control.type = UGauge
- SetupPlugin(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,Rec_$Worksheet.name$.Enable_$Control.name$,
- ResD_N_$Control.name$,ResD_H_$Control.name$,sResD_$Control.name$);
- SetupMinMaxValue(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,$Control.MinScroll$,$Control.MaxScroll$,Rec_$Worksheet.name$.Value_$Control.name$);
-
- $$EndLoop
- $$Loop Control.type = ScrollBar
- SetupTheItem(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,true,true,Rec_$Worksheet.name$.Enable_$Control.name$,true,&tempRect,0,0);
- SetupMinMaxValue(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,$Control.MinScroll$,$Control.MaxScroll$,Rec_$Worksheet.name$.Value_$Control.name$);
-
- $$EndLoop
-
- $$Link Worksheet.Open
-
- U_Setup_$Worksheet.name$(Rec_$Worksheet.name$.theDialog);/* Call the user Open procedure */
-
- ShowWindow(Rec_$Worksheet.name$.theDialog); /* Open a dialog box */
- SelectWindow(Rec_$Worksheet.name$.theDialog); /* Lets see it */
- }
- else
- SelectWindow(Rec_$Worksheet.name$.theDialog); /* Lets see it */
- }
-
- /* ======================================================= */
-
- /* Routine: Close_$Worksheet.name$ */
- /* Purpose: This procedures purpose is to close this window and clear */
- /* the window pointer variable */
-
- void Close_$Worksheet.name$(WindowPtr theWindow)
- {
- Rect tempRect; /* Temporary rectangle */
- short DType; /* Type of dialog item */
- Handle DItem; /* Handle to the dialog item */
-
-
- if ((Rec_$Worksheet.name$.theDialog != NIL) && (theWindow == Rec_$Worksheet.name$.theDialog))/* Only close if it is us and we were open */
- {
-
- U_Close_$Worksheet.name$(theWindow); /* Call the user close routine */
-
- $$Link Worksheet.Close
-
- $$if ModelessDialog.Movable
- Doing_MovableModal = false;
-
- $$endif ModelessDialog.Movable
- DisposDialog(theWindow); /* Close on the screen and Flush the dialog out of memory */
- Rec_$Worksheet.name$.theDialog = nil; /* Make sure our other routines know that we are closed */
- }
- }
-
- /* ======================================================= */
-
- /* Routine: Do_$Worksheet.name$ */
- /* Purpose: This procedures purpose is to handle all actions, such as buttons being pressed. */
- /* This is the real meat of this unit and is where the code is for acting upon the users actions. */
-
- void Do_$Worksheet.name$(EventRecord *theEvent,WindowPtr theWindow,short itemHit)
- {
- short Index; /* For looping */
- Point myPt; /* For the local mouse position */
- short DType; /* Type of dialog item */
- Handle DItem; /* Handle to the dialog item */
- Rect tempRect; /* Temporary rectangle */
- ControlHandle CItem; /* Control handle */
- short temp; /* temp integer */
- short code; /* temp integer */
- short theSelection; /* For Palettes */
- Boolean DoubleClick; /* For sensing double clicks in a list */
-
-
- Rec_$Worksheet.name$.ExitDialog = false; /* Do not close the dialog yet */
- $$if HasLists
- if ((theEvent->what == mouseDown) && (Rec_$Worksheet.name$.theDialog != nil))
- {
- SetPort(Rec_$Worksheet.name$.theDialog); /* Set the port to our dialog */
- myPt = theEvent->where; /* Get the position where the mouse was pressed */
- GlobalToLocal(&myPt); /* Change from global to local location */
-
- $$Loop Control.type = List
- if (PtInRect(myPt,&Rec_$Worksheet.name$.ListRect_$Control.name$))
- ClickInTheList(myPt,theEvent->modifiers,Rec_$Worksheet.name$.List_$Control.name$,$Control.TextSize$,$Control.TextFont$,$Control.TextStyle$,true);
-
- $$EndLoop Control.type
- }
- $$endif HasLists
-
- if ((Rec_$Worksheet.name$.theDialog != nil) && (Rec_$Worksheet.name$.theDialog == theWindow))
- {
- CheckKeysInDialog(theWindow,&DoubleClick,theEvent,&itemHit);
-
- myPt = theEvent->where; /* Get the position where the mouse was pressed */
- GlobalToLocal(&myPt); /* Change from global to local location */
-
- U_Hit_$Worksheet.name$(theWindow,&itemHit,&Rec_$Worksheet.name$.ExitDialog,theEvent);/* Give the user the itemhit */
-
- if (itemHit > 0) /* Skip if user set to zero */
- {
- GetDItem(theWindow, itemHit,&DType,&DItem,&tempRect);/* Get which item was pressed */
- CItem = (ControlHandle)DItem; /* Change the pointer for getting to the control */
- }
-
- /* Handle it real time */
- $$Loop Control.type = Button
- if (itemHit == ResD_$Control.name$) /* Handle the Button being pressed */
- {
- $$Link Control.Select
- $$if Control.ExitDialog
- Rec_$Worksheet.name$.ExitDialog = true; /* Close this dialog, exit */
- $$endif Control.ExitDialog
- }
-
- $$EndLoop Control.type
- $$Loop Control.type = Checkbox
- if (itemHit == ResD_$Control.name$) /* Handle the checkbox being pressed */
- {
- temp = GetCtlValue(CItem); /* Get the current Checkbox value */
- SetCtlValue(CItem, (temp + 1) & 1); /* Toggle the value to the opposite */
- Rec_$Worksheet.name$.Value_$Control.name$ = GetCtlValue(CItem); /* Get the current Checkbox value */
- $$if Control.HasLinks
- if (Rec_$Worksheet.name$.Value_$Control.name$ == 0)
- {
- $$Link Control.Deselect
- }
- else
- {
- $$Link Control.Select
- }
- $$endif
- }
-
- $$EndLoop Control.type
- $$Loop Control.type = UButton
- $$if Control.HasLinks
- if (itemHit == ResD_$Control.name$) /* Handle the Button being pressed */
- {
- $$Link Control.Select
- }
-
- $$endif
- $$EndLoop Control.type
- $$Loop Control.type = UToggle
- if (itemHit == ResD_$Control.name$) /* Handle the checkbox being pressed */
- {
- temp = GetCtlValue(CItem); /* Get the current Checkbox value */
- SetCtlValue(CItem, (temp + 1) & 1); /* Toggle the value to the opposite */
- Rec_$Worksheet.name$.Value_$Control.name$ = GetCtlValue(CItem); /* Get the current Checkbox value */
- $$if Control.HasLinks
- if (Rec_$Worksheet.name$.Value_$Control.name$ == 0)
- {
- $$Link Control.Deselect
- }
- else
- {
- $$Link Control.Select
- }
- $$endif
- }
-
- $$EndLoop Control.type
- $$Loop Control.type = Radio
- if (itemHit == ResD_$Control.name$) /* Handle the Radio being pressed */
- {
- SetCtlValue(CItem,1);
- Rec_$Worksheet.name$.Value_$Control.name$ = 1; /* Set the current Radio value */
-
- $$Loop RadioGroup
- ClearTheRadio(Rec_$Worksheet.name$.theDialog,ResD_$Control.name$,&Rec_$Worksheet.name$.Value_$Control.name$);
- $$EndLoop RadioGroup
- $$Link Control.Select
- }
-
- $$EndLoop Control.type
- $$Loop Control.type = HotRect
- $$if Control.HotSpot
- $$if Control.HasLinks
- if (itemHit == ResD_$Control.name$) /* Handle the HotSpot being pressed */
- {
- $$Link Control.Select
- }
-
- $$endif
- $$endif Control.HotSpot
- $$EndLoop
- $$Loop Control.type = Popup
- /* Popup */
-
- $$EndLoop
- $$Loop Control.type = Picture
- $$if Control.NonGraphic
- $$if Control.HasLinks
- if (itemHit == ResD_$Control.name$) /* Handle the Picture being pressed */
- {
- $$Link Control.Select
- }
-
- $$endif
- $$endif Control.NonGraphic
- $$EndLoop
- $$Loop Control.type = Palette
- /* Palette */
-
- $$EndLoop
- $$Loop Control.type = Icon
- $$if Control.NonGraphic
- $$if Control.HasLinks
- if (itemHit == ResD_$Control.name$) /* Handle the Icon being pressed */
- {
- $$Link Control.Select
- }
-
- $$endif
- $$endif Control.NonGraphic
- $$EndLoop
- $$Loop Control.type = Sicn
- $$if Control.NonGraphic
- $$if Control.HasLinks
- if (itemHit == ResD_$Control.name$) /* Handle the Sicn being pressed */
- {
- $$Link Control.Select
- }
-
- $$endif
- $$endif Control.NonGraphic
- $$EndLoop
-
- }
-
- if (Rec_$Worksheet.name$.ExitDialog) /* Do the close of the dialog */
- {
- Close_$Worksheet.name$(Rec_$Worksheet.name$.theDialog);
- Rec_$Worksheet.name$.theDialog = nil; /* Clear it for future checks */
- }
- }
-
- /* ======================================================= */
- /* ======================================================= */
- $$CloseFile
- $$EndLoop
-
-
-